package com.wss.day06.regex;

import java.util.Scanner;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/4/26
 */
public class Test7 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入");
        String password = sc.nextLine();

        int count = 0;
        //包含数字
        if(password.matches(".*[0-9].*")){
            count++;
        }
        //包含小写字母
        if(password.matches(".*[a-z].*")){
            count++;
        }
        //包含大写字母
        if(password.matches(".*[A-Z].*")){
            count++;
        }
        //包含特殊字符
        if(password.matches(".*[!@#\\$%\\^\\&\\*].*")){
            count++;
        }

        switch (count){
            case 1:
                System.out.println("密码强度较弱");
                break;
            case 2:
            case 3:
                System.out.println("密码强度较中");
                break;
            case 4:
                System.out.println("密码强度较强");
                break;
            default:
                System.out.println("输入有误");
                break;
        }
    }
    }
